package com.imooc.utils;

import com.imooc.VO.ResultVO;
import lombok.Getter;

@Getter
public class ResultVOUtils {
    //类里面写静态的方法
    //1.success
    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }

    //2. null
    public static ResultVO success(){
        return success(null);
    }

    //3.error
    public static ResultVO error(Integer code, String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
